package fem2.jnative;

/**
 * native interface for UmfPack
 * 
 * @author hbui
 * 
 */
public class JUmfPack {

	private static boolean available = true;
	private static String message = null;

	public static boolean isAvailable() {
		return available;
	}

	public static String getMessage() {
		return message;
	}

	static {
		try {
			// LibraryLoader.loadLibrary("UmfPackSolver");
			System.load("/home/hbui/workspace2/jni/UmfPackSolver/Release/libUmfPackSolver.so");
			// System.load("/home/hbui/workspace2/jni/UmfPackSolverNew/Release/libUmfPackSolverNew.so");
		} catch (UnsatisfiedLinkError e) {
			available = false;
			message = e.getMessage();
		}
	}

	public static native void solve(int n, int nz, int[] columnPointer, int[] rowIndex,
			double[] values, double[] x, double[] b);

}
